<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<!--    <meta name="viewport"-->
<!--          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">-->
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<script>

    function loadImage(src, resolve, reject) {
        let img = new Image()
        img.src = src;
        img.alt='image'
        img.onload = function () {
            resolve(img)
        }
        img.onerror = () => {
            reject('获取图片失败!')
        }
    }

    loadImage('http://iwenwiki.com/api/vue3-image/create-vue3-1.png',
        data => {
            console.log(data)
            // document.appendChild(data)
            document.documentElement.appendChild(data)
        }, err => {
            console.log(err)
        })

</script>
<div style="color: white">this </div>
</body>
</html>
